/**
 * Copyright (c) 2020 kedacom
 * OpenATC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 * http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 **/
const tscParam = {
  phaseList: [],
  patternList: [],
  planList: [],
  dateList: [],
  overlaplList: [],
  channelList: [],
  detectorList: [],
  pedestrainDetectorList: [],
  channellock: [],
  // customInfo: {
  //   areaid: Number,
  //   intersectionid: Number,
  //   siteid: '',
  //   selflearning: 0,
  //   fixintersectioninfo: '',
  //   commuport: 0,
  //   commutype: '',
  //   steptype: ''
  // },
  manualpanel: {
    mingreen: 15
  },
  singleoptim: [
  ]
}
const Global = {
  state: {
    tscParam: JSON.parse(JSON.stringify(tscParam)),
    associatedPhaseList: [], // 关联相位列表
    PhaseDataMgr: {} // 关联相位数据处理模型
  },
  mutations: {
    SET_TSCPARAM: (state, tscParam) => {
      state.tscParam = JSON.parse(JSON.stringify(tscParam))
    },
    SET_ASSOCIATED_PHASE_LIST: (state, Associatedphaselist) => {
      state.associatedPhaseList = JSON.parse(JSON.stringify(Associatedphaselist))
    },
    INIT_PHASE_DATA_MGR: (state, PhaseDataMgrClass) => {
      state.PhaseDataMgr = PhaseDataMgrClass
    }
  },
  actions: {
    SetTscParam ({ commit }, tscParam) {
      commit('SET_TSCPARAM', tscParam)
    },
    SetAssociatedPhaseList ({ commit }, Associatedphaselist) {
      commit('SET_ASSOCIATED_PHASE_LIST', Associatedphaselist)
    },
    InitPhaseDataMgr ({ commit }, PhaseDataMgrClass) {
      commit('INIT_PHASE_DATA_MGR', PhaseDataMgrClass)
    }
  }
}
export default Global
